package org.jground.rx.def.apps.accounting;
import org.jground.rx.*;
import org.jground.rx.gen.*;
import org.jground.util.*;
import java.util.List;
import org.jground.rx.def.apps.commons.*;
import org.jground.rx.def.apps.knowledge.*;
import org.jground.rx.def.*;
import org.jground.rx.def.apps.crm.*;
import org.jground.rx.def.apps.cip.*;
import org.jground.rx.def.apps.core.*;
import org.jground.rx.def.apps.legal.*;
import org.jground.rx.def.apps.ipm.*;
@SuppressWarnings("unused")
public class ActivityType extends GenRoot {

    public static final String moid = "org.jground.rx.def.apps.accounting.ActivityType";

    private static final String name ="name";
    private static final String code ="code";
    private static final String description ="description";
    private static final String vat ="vat";
    private static final String $CREATOR ="$CREATOR";

    public static final class AttName {
        public static final String name ="name";
        public static final String code ="code";
        public static final String description ="description";
        public static final String vat ="vat";
        public static final String $CREATOR ="$CREATOR";
    }

    public static ActivityType createNew() { return new ActivityType(RXObjectService.getInstance().create(moid)); }

    public static ActivityType getById(String oid) { 
        IRXObject mod = RXObjectService.getInstance().getById(oid);
        if(mod == null) { return null; }
        return new ActivityType(mod);
    }

    public static ActivityType[] getByIds(String... oids) { 
        List<IRXObject> mods = RXObjectService.getInstance().getByIds(moid, oids);
        ActivityType[] res = new ActivityType[mods.size()];
        int i = 0;
        for(IRXObject mod : mods) {
            res[i] = new ActivityType(mod);
            i++;
        }
        return res;
    }

    public static SearchCriteria newSearchCriteria() {
        return  SearchCriteria.create(moid);
    }

    public static ActivityType[] search(SearchCriteria sc) {
        return  wrap(GenRoot._search(sc));
    }

    public static ActivityType[] wrap(List<? extends IRXObjectSynopsis> mods) { 
        ActivityType[] res = new ActivityType[mods.size()];
        int i = 0;
        for(IRXObjectSynopsis mod : mods) {
            res[i] = new ActivityType(mod);
            i++;
        }
        return res;
    }

    public static ActivityType wrap(IRXObjectSynopsis mod) { 
        return new ActivityType(mod);
    }

    private ActivityType(IRXObjectSynopsis rxObject) {this.rxObject = (IRXObject) rxObject;}

    public static String getNameLabel() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, name).getLabel();
    }

    public static String getNameDescription() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, name).getDescription();
    }

    public void setName(String string) {
        rxObject.set(name, _to_String(string));
    }

    public String getName() {
        return _to_String(rxObject.getCurrentValue(name));
    }

    public static String getCodeLabel() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, code).getLabel();
    }

    public static String getCodeDescription() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, code).getDescription();
    }

    public void setCode(String string) {
        rxObject.set(code, _to_String(string));
    }

    public String getCode() {
        return _to_String(rxObject.getCurrentValue(code));
    }

    public static String getDescriptionLabel() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, description).getLabel();
    }

    public static String getDescriptionDescription() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, description).getDescription();
    }

    public void setDescription(String text) {
        rxObject.set(description, _to_String(text));
    }

    public String getDescription() {
        return _to_String(rxObject.getCurrentValue(description));
    }

    public static String getVatLabel() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, vat).getLabel();
    }

    public static String getVatDescription() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, vat).getDescription();
    }

    public void setVat(Double doubleValue) {
        rxObject.set(vat, _to_String(doubleValue));
    }

    public Double getVat() {
        return _to_Double(rxObject.getCurrentValue(vat));
    }

    public static String get$CREATORLabel() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, $CREATOR).getLabel();
    }

    public static String get$CREATORDescription() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, $CREATOR).getDescription();
    }

    public void set$CREATOR(String string) {
        rxObject.set($CREATOR, _to_String(string));
    }

    public String get$CREATOR() {
        return _to_String(rxObject.getCurrentValue($CREATOR));
    }

}
